import { request, HttpMethod, restartTimes, RequestConfig } from './request'
// BPL相关操作

export const getWeekValue = (date: string) => {
  const config = <RequestConfig>{
    url: `/patient/persureHeartRate/get_week_range`,
    method: HttpMethod.GET,
    data: {
      date: date,
    }
  }
  return request(config); 
}

export const getChartDay = (data: Object) => {
  const config = <RequestConfig>{
    url: `/patient/persureHeartRate/dailyPressureData`,
    method: HttpMethod.GET,
    data: data
  }
  return request(config);
}

export const getSBPDay = (data: Object) => {
  const config = <RequestConfig>{
    url: `/patient/persureHeartRate/todayMaxMinAvgSystolic`,
    method: HttpMethod.GET,
    data: data
  }
  return request(config);
}

export const getDBPDay = (data: Object) => {
  const config = <RequestConfig>{
    url: `/patient/persureHeartRate/todayMaxMinAvgDiastolic`,
    method: HttpMethod.GET,
    data: data
  }
  return request(config);
}

export const getGapDay = (data: object) => {
  const config = <RequestConfig>{
    url: `/patient/persureHeartRate/todayMaxMinAvgPressureDiff`,
    method: HttpMethod.GET,
    data: data
  }
  return request(config);
}

export const getAbnormalDay = (data: Object) => {
  const config = <RequestConfig>{
    url: `/patient/persureHeartRate/getRiskNum`,
    method: HttpMethod.GET,
    data: data
  }
  return request(config);
}

export const getRecordDay = (data: Object) => {
  const config = <RequestConfig>{
    url: `/patient/persureHeartRate/get_daily_anomaly_stats`,
    method: HttpMethod.GET,
    data: data
  }
  return request(config);
}

export const getChartWeek = (data: Object) => {
  const config = <RequestConfig>{
    url: `/patient/persureHeartRate/weeklyAvgPressureByDay`,
    method: HttpMethod.GET,
    data: data
  }
  return request(config);
}

export const getSBPWeek = (data: Object) => {
  const config = <RequestConfig>{
    url: `/patient/persureHeartRate/WeekMaxMinAvgSystolic`,
    method: HttpMethod.GET,
    data: data
  }
  return request(config);
}

export const getDBPWeek = (data: Object) => {
  const config = <RequestConfig>{
    url: `/patient/persureHeartRate/WeekMaxMinAvgDiastolic`,
    method: HttpMethod.GET,
    data: data
  }
  return request(config);
}

export const getGapWeek = (data: object) => {
  const config = <RequestConfig>{
    url: `/patient/persureHeartRate/WeekMaxMinAvgPressureDiff`,
    method: HttpMethod.GET,
    data: data
  }
  return request(config);
}

export const getAbnormalWeek = (data: Object) => {
  const config = <RequestConfig>{
    url: `/patient/persureHeartRate/weekAnomalyCount`,
    method: HttpMethod.GET,
    data: data
  }
  return request(config);
}

export const getRecordWeek = (data: Object) => {
  const config = <RequestConfig>{
    url: `/patient/persureHeartRate/get_weekly_anomaly_stats`,
    method: HttpMethod.GET,
    data: data
  }
  return request(config);
}

export const getChartMonth = (data: Object) => {
  const config = <RequestConfig>{
    url: `/patient/persureHeartRate/monthlyAvgPressureByWeek`,
    method: HttpMethod.GET,
    data: data
  }
  return request(config);
}

export const getSBPMonth = (data: Object) => {
  const config = <RequestConfig>{
    url: `/patient/persureHeartRate/MonthMaxMinAvgSystolic`,
    method: HttpMethod.GET,
    data: data
  }
  return request(config);
}

export const getDBPMonth = (data: Object) => {
  const config = <RequestConfig>{
    url: `/patient/persureHeartRate/MonthMaxMinAvgDiastolic`,
    method: HttpMethod.GET,
    data: data
  }
  return request(config);
}

export const getGapMonth = (data: object) => {
  const config = <RequestConfig>{
    url: `/patient/persureHeartRate/MonthMaxMinAvgPressureDiff`,
    method: HttpMethod.GET,
    data: data
  }
  return request(config);
}

export const getAbnormalMonth = (data: Object) => {
  const config = <RequestConfig>{
    url: `/patient/persureHeartRate/monthAnomalyCount`,
    method: HttpMethod.GET,
    data: data
  }
  return request(config);
}

export const getRecordMonth = (data: Object) => {
  const config = <RequestConfig>{
    url: `/patient/persureHeartRate/get_monthly_anomaly_stats`,
    method: HttpMethod.GET,
    data: data
  }
  return request(config);
}

export const addBPLRecord = (data: Object) => {
  const config = <RequestConfig>{
    url: `/patient/persureHeartRate/add`,
    method: HttpMethod.POST,
    data: data
  }
  return request(config);
}
export const getBPLReminder = (data: Object) => {
  const config = <RequestConfig>{
    url: `/patient/persureHeartRate/add`,
    method: HttpMethod.POST,
    data: data
  }
  return request(config);
}
export const setBPLReminder = (data: Object) => {
  const config = <RequestConfig>{
    url: `/patient/persureHeartRate/add`,
    method: HttpMethod.POST,
    data: data
  }
  return request(config);
}